package com.yckj.ytracker.api.util;

import java.io.PrintWriter;
import java.io.StringWriter;

/**
 * @author tcl
 */

public class StackUtil {

    public static String getStack(Throwable t) {
        if (t == null) {
            System.out.println("YTracker: stack of throwable null");
            return "";
        }

        StringWriter stringWriter = new StringWriter();
        t.printStackTrace(new PrintWriter(stringWriter));
        return stringWriter.toString();
    }
}
